package com.k7.mobile.platform.bo.impl;

import java.util.List;

import com.k7.mobile.platform.bo.IRecommendxBO;
import com.k7.mobile.platform.dao.IRecommendxDAO;
import com.k7.mobile.platform.dataobject.RecommendxDO;
import com.k7.mobile.platform.exception.BOException;

public class RecommendxBOImpl extends BaseBOImpl implements IRecommendxBO{
	
	private IRecommendxDAO recommendxDAO;

	public void setRecommendxDAO(IRecommendxDAO recommendxDAO) {
		this.recommendxDAO = recommendxDAO;
	}

	public Long add(RecommendxDO recommendxDO) throws BOException {
		try{ 
			Long id=recommendxDAO.add(recommendxDO);
			return id;
		}catch(Exception ex){
			log.error("RecommendxBOImpl:add,插入Recommendx失败", ex);
			throw new BOException("创建禁止Recommendx失败", ex);
		}
	}

	@Override
	public void delete(RecommendxDO recommendxDO) throws BOException {
		try{
			recommendxDAO.delete(recommendxDO);
		}catch(Exception ex){
			log.error("RecommendxBOImpl:delete,删除Recommendx失败", ex);
			throw new BOException("删除Recommendx失败", ex);
		}
		
	}
	@Override
	public void update(RecommendxDO recommendxDO) throws BOException {
		try{
			recommendxDAO.update(recommendxDO);
		}catch(Exception ex){
			log.error("RecommendxBOImpl:update,更新Recommendx失败", ex);
			throw new BOException("更新Recommendx失败", ex);
		}
		
	}

	@Override
	public List<RecommendxDO> findList(RecommendxDO recommendxDO) throws BOException {
		try{
			List<RecommendxDO> list = recommendxDAO.findList(recommendxDO);
			return list;
		}catch(Exception ex){
			log.error("RecommendxBOImpl:findList,批量获取Recommendx信息出错", ex);
			throw new BOException("批量获取Recommendx信息出错", ex);
		}
		
	}

	@Override
	public RecommendxDO getRecommendx(RecommendxDO recommendxDO) throws BOException {
		try{

			RecommendxDO returnDO = recommendxDAO.getRecommendx(recommendxDO);

			return returnDO;
		}catch(Exception ex){
			log.error("RecommendxBOImpl:getRecommendx,获取Recommendx信息出错", ex);
			throw new BOException("获取Recommendx信息出错", ex);
		}
	}
}
